package rus.sq.osTicket.Mobile;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import org.w3c.dom.Text;

/**
 * Created by Соловьев Максим on 02.12.2014.
 */
public class VTFLVAdapter extends ArrayAdapter<String>
{
    private final Context context;
    private final Ticket ticket;

    public VTFLVAdapter(Context context,Ticket ticket) {
        super(context, R.layout.vtf_listview_item);
        this.context = context;
        this.ticket = ticket;
    }

    @Override
    public View getView(int position,View convertView, ViewGroup parent){
        LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View rowView = inflater.inflate(R.layout.vtf_listview_item,parent,false);
        ImageView img = (ImageView)rowView.findViewById(R.id.vtflvi_imageView);
        TextView txtTicketNum = (TextView)rowView.findViewById(R.id.vtflvi_tv_ticket);
        txtTicketNum.setText(ticket.getNumber());
        TextView txtTicketDate = (TextView)rowView.findViewById(R.id.vtflvi_tv_ticketdate);
        txtTicketDate.setText(ticket.getCreated().toString());
        TextView txtTicketPrio = (TextView)rowView.findViewById(R.id.vtflvi_tv_priority);
/*        txtTicketPrio.setText(ticket.get);
        TextView txtTicketSubj = (TextView)rowView.findViewById(R.id.vtflvi_tv_subject);
        txtTicketSubj.setText(ticket.get);
        TextView txtTicketRec = (TextView)rowView.findViewById(R.id.vtflvi_tv_recepient);
        txtTicketRec.setText(ticket.getRecepient()); */
        return rowView;
    }
}
